<include file="public@header"/>
<link rel="stylesheet" href="__TMPL__/public/assets/bootstrapSwitch/bootstrapSwitch.css">
<script src="__TMPL__/public/assets/bootstrapSwitch/bootstrapSwitch.js"></script>
<style>
    .card_price .form-control{float: left;width: 85%;}
    .card_price .input-group-addon{ padding: 9px;width: 15%;float: right}
</style>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li><a href="{:url('admin_store/index')}">店铺管理</a></li>
        <li><a href="{:url('admin_store/add')}">添加店铺</a></li>
        <li class="active"><a href="JavaScript:;">店铺详情</a></li>
    </ul>
    <div class="row margin-top-20">
        <div class="col-md-2">
            <include file="public@left"/>
        </div>
        <div class="col-md-10">
            <div class="tab-content">
                <form action="{:url('admin_store/card')}" method="post" class="form-horizontal js-ajax-form">
                    <input type="hidden"  name="id" value="{$store_id}"/>
                <table class="table table-hover table-bordered">
                    <thead>
                    <tr>
                        <th>会员卡</th>
                        <th>体验卡</th>
                        <th>半年卡</th>
                        <th>年卡</th>
                        <th>家庭股东年卡</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <td>状态</td>
                        <td>
                            <div class="switch" data-on="primary" data-off="info">
                                <input type="checkbox"  name="seven_days_card" <eq name="store_info['seven_days_card']" value="1">checked</eq>/>
                            </div>
                        </td>
                        <td>
                            <div class="switch" data-on="primary" data-off="success">
                                <input type="checkbox"   name="monthly_card" <eq name="store_info['monthly_card']" value="1">checked</eq>/>
                            </div>
                        </td>
                        <td>
                            <div class="switch" data-on="primary" data-off="warning">
                                <input type="checkbox"   name="half_year_card" <eq name="store_info['half_year_card']" value="1">checked</eq>/>
                            </div>
                        </td>
                        <td>
                            <div class="switch" data-on="primary" data-off="danger">
                                <input type="checkbox"   name="year_card" <eq name="store_info['year_card']" value="1">checked</eq>/>
                            </div>
                        </td>
                    </tr>
                    <php>
                        $seven_content='';
                        $seven_price='';
                        $seven_score='';
                        $monthly_content='';
                        $monthly_price='';
                        $monthly_score='';
                        $half_year_content='';
                        $half_year_price='';
                        $half_year_score='';
                        $year_content='';
                        $year_price='';
                        $year_score='';
                    </php>
                    <foreach name="card_info" item="v">
                        <php>

                            if($v['type']==1){
                                $seven_content=isset($v['card_info'])?'总价值4218元商品和658积分':'总价值4218元商品和658积分';
                                $seven_price=isset($v['price'])?$v['price']:'658';
                                $seven_score=isset($v['score'])?'658':'658';
                            }
                            if($v['type']==2){
                                $monthly_content=isset($v['card_info'])?'总价值12940元商品和6980积分':'总价值12940元商品和6980积分';
                                $monthly_price=isset($v['price'])?$v['price']:'6980';
                                $monthly_score=isset($v['score'])?'6980':'6980';
                            }
                            if($v['type']==3){
                                 $half_year_content=isset($v['card_info'])?'总价值28656元商品和12800积分':'总价值28656元商品和12800积分';
                                 $half_year_price=isset($v['price'])?$v['price']:'12800';
                                $half_year_score=isset($v['score'])?'12800':'12800';
                            }
                            if($v['type']==4){
                                $year_content=isset($v['card_info'])?'总价值101160元商品和29800积分':'总价值101160元商品和29800积分';
                                $year_price=isset($v['price'])?$v['price']:'29800';
                                $year_score=isset($v['score'])?'29800':'29800';
                            }
                        </php>
                    </foreach>
                    <tr>
                        <td>赠送套餐</td>
                        <td>
                            <input type="text" placeholder="200积分+洗面奶+乳液+SPA柔肤水" name="seven_content" class="form-control" value="{$seven_content}" readonly>
                        </td>
                        <td>
                            <input type="text" placeholder="200积分+洗面奶+乳液+SPA柔肤水" name="monthly_content" class="form-control" value="{$monthly_content}" readonly>
                        </td>
                        <td>
                            <input type="text" placeholder="200积分+洗面奶+乳液+SPA柔肤水" name="half_year_content" class="form-control" value="{$half_year_content}" readonly>
                        </td>
                        <td>
                            <input type="text" placeholder="200积分+洗面奶+乳液+SPA柔肤水" name="year_content" class="form-control" value="{$year_content}" readonly>
                        </td>
                    </tr>
                    <tr class="card_price">
                        <td>售价</td>
                        <td>
                            <input type="number" placeholder="请填写售价" name="seven_price" class="form-control" value="{$seven_price}"><span class="input-group-addon">元</span>
                        </td>
                        <td>
                            <input type="number" placeholder="请填写售价" name="monthly_price" class="form-control" value="{$monthly_price}"><span class="input-group-addon">元</span>
                        </td>
                        <td>
                            <input type="number" placeholder="请填写售价" name="half_year_price" class="form-control" value="{$half_year_price}"><span class="input-group-addon">元</span>
                        </td>
                        <td>
                            <input type="number" placeholder="请填写售价" name="year_price" class="form-control" value="{$year_price}"><span class="input-group-addon">元</span>
                        </td>
                    </tr>
                    <tr class="card_price">
                        <td>赠送积分</td>
                        <td>
                            <input type="number" placeholder="请填写赠送积分" name="seven_score" class="form-control" value="{$seven_score}" readonly><span class="input-group-addon" >积分</span>
                        </td>
                        <td>
                            <input type="number" placeholder="请填写赠送积分" name="monthly_score" class="form-control" value="{$monthly_score}" readonly><span class="input-group-addon" >积分</span>
                        </td>
                        <td>
                            <input type="number" placeholder="请填写赠送积分" name="half_year_score" class="form-control" value="{$half_year_score}" readonly><span class="input-group-addon" >积分</span>
                        </td>
                        <td>
                            <input type="number" placeholder="请填写赠送积分" name="year_score" class="form-control" value="{$year_score}" readonly><span class="input-group-addon" >积分</span>
                        </td>
                    </tr>
                    </tbody>
                </table>
                    <div class="form-group">
                        <div class="col-sm-10">
                            <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
</body>
</html>